<template>
  <fix-window />
  <view v-if="target != '_blank'">
    <web-view :src="url"></web-view>
  </view>
</template>

<script>
  import {mapState} from "vuex"
  export default {
    data() {
      return {
        url: ''
      }
    },
    computed:{
      ...mapState("user", ['token'])
    },
    onLoad(e) {
      this.url = decodeURIComponent(e.url);
      if (this.url.indexOf("?") > -1) {
        this.url += "&";
      } else {
        this.url += '?';
      }
      
      this.url += "token=" + this.token

      if (e.target == "_blank") {
        if (window) {
          window.open(this.url)
          uni.navigateBack()
        }
      } else {
        if(this.hideTopWindow){
          uni.hideTopWindow()
        }
        this.hideLeftWindow && uni.hideLeftWindow()
      }

    },
    methods: {

    }
  }
</script>

<style>

</style>